/* Booking.java
 * 
 * Alex Schwartz
 * Derek Dupuis
 * Mike Dixey
 * Greg Warner
 * 
 * 
 * This class keeps track of capacities and times for
 * bookings to allow for provider to keep track of
 * capacity at certain times.
 * 
 */

import java.util.*;
import java.text.*;

public class Booking
{
   private GregorianCalendar startTime;
   private GregorianCalendar endTime;
   private int capacity;
   
   public Booking( int c, GregorianCalendar sT, GregorianCalendar eT )
   {
      capacity = c;
      startTime = sT;
      endTime = eT;
   }
   
   //------------------------accessors------------------------------
   public GregorianCalendar startTime() { return startTime; }
   
   public GregorianCalendar endTime() { return endTime; }
   
   public int capacity() { return capacity; }
   
   public String toString()
   {
      String s = "";
      DateFormat tF = DateFormat.getDateTimeInstance( DateFormat.LONG,
                                                     DateFormat.LONG );
      s = String.format( "StartTime: %s EndTime: %s Capacity: %d\n",
                        tF.format( startTime.getTime() ),
                        tF.format( endTime.getTime() ), capacity );
      return s;
   }
}